package net.xinqushi.pthread.pthread.group;

public class ThreadInterruptGroupTest {
    public static void main(String[] args) throws InterruptedException {
        new Thread(()->
            { while (!Thread.currentThread().isInterrupted()){}}).start();
        new Thread(()->
        {while (!Thread.currentThread().isInterrupted()){}}).start();
        ThreadGroup mainGroup = Thread.currentThread().getThreadGroup();
        mainGroup.list();
        //Interrupts all threads in this thread group and subgroups recursively
        mainGroup.interrupt();
        //mainGroup.destroy();
    }
}
